<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>

        let bubbleSort = function(nums){
            for(let i = 0; i < nums.length-1; i++){
                for(let j = 0; j < nums.length-1-i; j++){
                    if(nums[j] > nums[j+1]){
                        let temp = nums[j];
                        nums[j] = nums[j+1];
                        nums[j+1] = temp;
                    }
                }
            }
        }
        let nums = [12,3,65,7,99,14,66];
        bubbleSort(nums);
        console.log(nums);
    </script>
</body>
</html>